package com.zjitc;


import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author Administrator
 */
public class App1
{

  public static void main(String[] args) {
    ApplicationContext context=new AnnotationConfigApplicationContext(DataSourceConfiguration1.class);
    DataSource ds =context.getBean(DataSource.class);
    try {
      Connection connection=ds.getConnection();
      System.out.println(connection);
    } catch (SQLException e) {
      e.printStackTrace();
    }


  }
}
